#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = 3e5+10;

db f[N],g[N],p[N];
int n;
char s[N];

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in; scanf("%s",s + 1);
	for(int i = 1;i <= n;i++){
		if(s[i] == 'o') p[i] = 1.0;else if(s[i] == '?') p[i] = 0.5;else p[i] = 0;
		f[i] = (f[i-1] + 1) * p[i];
		g[i] = g[i - 1] + (2 * f[i-1] + 1) * p[i];
	}
	printf("%.4lf",g[n]);
	return 0;
}

